<?php
// 连接数据库
include 'connect.php';
if (isset($_GET['id'])) {
    $employeeId = $_GET['id'];
    // 执行删除操作
    $sql = "DELETE FROM employees WHERE id = $employeeId";
    mysqli_query($conn, $sql);
    ?>
    <!DOCTYPE html>
    <html lang="zh">
    <head>
        <meta charset="UTF-8">
        <title>员工删除成功</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
        <script src="https://code.jquery.com/jquery-3.7.1.js"></script>
    </head>
    <body>
    <?php include 'nav.php' ?>
    <div class="container mt-5">
        <h2 class="alert alert-success">员工已删除</h2>
        <button onclick="window.history.go(-1)" class="btn btn-primary">返回</button>

    </div>
    </body>
    </html>
    <?php
} else {
    echo "无效的请求";
}
?>